﻿<%@ Page Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="ReadPost.aspx.cs" Inherits="Presentation.Posts.ReadPost" %>

<%@ Register Assembly="CollectionPager" Namespace="SiteUtils" TagPrefix="cC" %>
<asp:Content ID="Content" ContentPlaceHolderID="main" runat="server">
    <!--View details of the post-->
    <div class="entry-short-item">
        <asp:DataList ID="ViewAllEntry" runat="server">
            <ItemTemplate>
                <p>
                    <span style="color: skyblue; font-size: 20px">
                        <asp:Label ID="titleLabel" runat="server" Text='<%#Eval("Title") %>'></asp:Label>
                    </span>
                    <br/>
                    <p>
                        <span class="date">
                        Date: &nbsp;<asp:Label ID="lblDate" runat="server" Text='<%#Eval("DatePost") %>'></asp:Label>
                        </span>
                        Author: <a href=""><asp:Label ID="lblAuthor" runat="server" Text='<%#Eval("Fullname") %>'></asp:Label></a>
                        &nbsp;|&nbsp;
                        Category:&nbsp;
                        <a href="">
                            <asp:Label ID="lblCategory" runat="server" Text='<%#Eval("CateName") %>'></asp:Label>
                        </a>
                        <a href="#" class="comments">
                            Comments: &nbsp;
                            <span>
                                <asp:Label ID="lblCountCmt" runat="server" Text='<%#Eval("CommentCount") %>'></asp:Label>
                            </span>
                        </a>
                    </p>
                    <p>
                        <asp:Label ID="lblContent" runat="server" Text='<%#Eval("Content") %>'></asp:Label>
                    </p>
                </p>
            </ItemTemplate>
        </asp:DataList>
    </div>
    <!--View all comments-->
    <div class="entry-short-item">
        <h3>Danh sách comment:</h3>
        <asp:DataList ID="ViewAllComments" runat="server">
            <ItemTemplate>
                <p style="text-align: left">
                    <a href="">
                        <asp:Label ID="lblUserComment" runat="server" Text='<%#Eval("UserComment") %>'></asp:Label>
                    </a>
                    | At &nbsp;
                    <a href="">
                        <asp:Label ID="lblCmtDate" runat="server" Text='<%#Eval("CmtDate") %>'></asp:Label>
                    </a>
                </p>
                <p style="text-align: left">
                    <asp:Label ID="lblComment" runat="server" Text='<%#Eval("CommentContent") %>'></asp:Label>
                </p>
                <hr/>
            </ItemTemplate>
        </asp:DataList>
        <!--Comment navigation-->
        <p class="pages">
            <cC:CollectionPager ID="CollectionPager1" runat="server" BackText="[ « Trước ]" FirstText="Đầu"
                LabelText="Trang : " LastText="Cuối" NextText="[ Tiếp » ]" ResultsLocation="None"
                BackNextLocation="Right" LabelStyle="">
            </cC:CollectionPager>
        </p>
    </div>
    <!--Post comment-->
    <div class="entry-short-item">
        <table>
            <tr>
                <td colspan="3" style="text-align: left; color: lightskyblue; font-size: 25px;">
                    Đăng bình luận tại đây
                    <br/>
                </td>
            </tr>
            <tr>
                <td>
                    
                </td>
            </tr>
            <tr>
                <td>
                    Tên của bạn:
                </td>
                <td>
                    <asp:TextBox ID="txtUserCommentName" runat="server" Width="230px"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ValidationGroup="groupPostComment"
                    ControlToValidate="txtUserCommentName" ErrorMessage="Bạn chưa nhập dữ liệu!" SetFocusOnError="True">
                    </asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    Comment (*):
                </td>
                <td>
                    <asp:TextBox ID="txtComment" runat="server" TextMode="MultiLine" Width="230px" Height="200px"></asp:TextBox>
                </td>
                <td>
                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ValidationGroup="groupPostComment"
                    ControlToValidate="txtComment" ErrorMessage="Bạn chưa nhập dữ liệu." SetFocusOnError="True">
                    </asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr>
                <td>
                    
                </td>
                <td>
                    <asp:Button ID="buttonSubmitComment" ValidationGroup="groupPostComment" runat="server" 
                        Text="Đăng bình luận" onclick="ButtonSubmitCommentClick"/>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>